/**
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.skali.cabdirectories.service.impl;

import java.util.HashMap;
import java.util.List;

import com.liferay.portal.kernel.exception.SystemException;
import com.skali.cabdirectories.model.CABDirectories_Metadata;
import com.skali.cabdirectories.service.CABDirectories_MetadataLocalServiceUtil;
import com.skali.cabdirectories.service.base.CABDirectories_MetadataServiceBaseImpl;
import com.skali.portal.util.Constants;

/**
 * The implementation of the c a b directories_ metadata remote service.
 *
 * <p>
 * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link com.skali.cabdirectories.service.CABDirectories_MetadataService} interface.
 *
 * <p>
 * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
 * </p>
 *
 * @author Prabhakar
 * @see com.skali.cabdirectories.service.base.CABDirectories_MetadataServiceBaseImpl
 * @see com.skali.cabdirectories.service.CABDirectories_MetadataServiceUtil
 */
public class CABDirectories_MetadataServiceImpl
extends CABDirectories_MetadataServiceBaseImpl {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never reference this interface directly. Always use {@link com.skali.cabdirectories.service.CABDirectories_MetadataServiceUtil} to access the c a b directories_ metadata remote service.
	 */


	/** This is our custom liferay-service exposed that returns the List<CABDirectories_Metadata> filtered on the following Params
	 * @param - sammno
	 * @param - acbNo
	 *  @param - organizationName
	 *  @param - field
	 *  
	 */
	public List<CABDirectories_Metadata> fetchCabDirectories_Metadata_ByCustomFields(long sammno, String organizationName , String field) throws SystemException{

		
		HashMap<String, Object> searchFieldsMap =  new HashMap<String, Object>();
		searchFieldsMap.put(Constants.SammNo, sammno);
		searchFieldsMap.put(Constants.OrganizationName, organizationName);
		searchFieldsMap.put(Constants.Field, field);
		return cabDirectories_MetadataFinder.fetchByCustomCabDirectories_MetadataFields(searchFieldsMap);
		
	}

	

	/** This is a custom liferay service exposed that fetches the Metadata based on the sammno.
	 * @param - sammno
	 */
	public CABDirectories_Metadata fetchMetadataBySammNo(long sammno){

		CABDirectories_Metadata cabDirectories_Metadata = null;
		try {
			cabDirectories_Metadata = cabDirectories_MetadataLocalService.fetchCABDirectories_Metadata(sammno);
		} catch (SystemException e) {
			e.printStackTrace();
		}
		return cabDirectories_Metadata;
	}
}